package com.yanqu.road.server.cmd.union.cross;

import com.yanqu.road.pb.union.UnionProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_UNION_QUERY, desc = "查看联盟")
public class QueryUnionCmd extends AbstractCommand {

	private String unionUid;


	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		UnionProto.UnionQueryReqMsg reqMsg = UnionProto.UnionQueryReqMsg.parseFrom(packet.getBytes());
		unionUid = reqMsg.getUnionUid();
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {

		player.sendPacket(Protocol.C_UNION_QUERY, UnionProto.UnionQueryReqMsg.newBuilder().setUnionUid(unionUid));
	}

	@Override
	public void sendData(GamePlayer player) {

	}

}
